<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/init.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<jsp:include page="/WEB-INF/jsp/common/common.jsp" />
<jsp:include page="/WEB-INF/jsp_lib/validate.jsp" />
<jsp:include page="/WEB-INF/jsp_lib/my97.jsp" />
<script type="text/javascript">
	$(function() {
		$("select[name='user_id']").val("${worklog.user_id}");
	});

	$(function() {
		$("#form1").validate({
			rules : {
				'content' : {
					required : true,
					maxlength : 255
				},
				'note' : {
					maxlength : 255
				}
			}
		});
	});

	function getlist() {
		var date_msg = $("#date_time_msg").val();
		var url = "${path}/ix/worklog/edit_form.htm?date=" + date_msg;
		window.location.href = url;
	}

	function mySubmit() {
		$("#form1").submit();
	}
	$(function() {
		//设置各状态颜色
		$exam_status = $(".exam_status");
		$.each($exam_status, function() {
			var st = $.trim($(this).html());
			if (st == "通过") {
				$(this).css("color", "green");
			} else if (st == "待审核") {
				$(this).css("color", "blue");
			} else if (st == "未通过") {
				$(this).css("color", "red");
			} else {
			}
		});

	});
</script>
</head>
<body>
	<jsp:include page="/WEB-INF/jsp_lib/tip.jsp" />
	<!-- 内容 -->
	<div>
		<form method="post" action="${path}/ix/worklog/edit.htm" id="form1">
			<input type="hidden" name="worklog_id" value="${worklog._id}" />
			<h2>
				<div>工作日志</div>
			</h2>
			<table width="100%" class="lindex">
				<tr>
					<th align="right">日期：</th>
					<td align="left"><input name="date_time_msg"
						id="date_time_msg" value="${date}" type="text" maxlength="20"
						onfocus="WdatePicker({onpicked:getlist})" class="Wdate" /></td>
				</tr>
				<c:if test="${worklog.content!=null}">
					<tr>
						<th align="right">审核状态：</th>
						<td align="left" class="exam_status">${worklog.exam_status}</td>
					</tr>
				</c:if>
				<tr>
					<th align="right">工作内容：</th>
					<td align="left" colspan="5"><textarea name="content" rows="5"
							cols="50">${worklog.content}</textarea></td>
				</tr>
				<c:if test="${worklog.exam_note!=null}">
					<tr>
						<th align="right">备注：</th>
						<td align="left" colspan="5">${worklog.exam_note}</td>
					</tr>
				</c:if>
			</table>
			<div class="options">
				<a href="javascript:mySubmit();" class="asave"> 【保存】 </a>
			</div>
		</form>
		<div>
			<a href="${path}/ix/worklog/list.htm">【显示全部工作日志】</a>
		</div>
	</div>
</body>
</html>